// 封装按钮
<template>
  <div
    class="btn"
    :class="{
      success: type == 'success',
      primary: type == 'primary',
      danger: type == 'danger',
    }"
    @click="handlerClick"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    handlerClick(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  width: 314 * 100vw/360;
  height: 50px;
  background-color: rgba(95, 185, 35, 0.808);
  border-radius: 25px;
  line-height: 50px;
  text-align: center;
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  margin: 0 auto;
}
.success {
  background-color: rgba(99, 209, 35, 0.815);
  color: #fff;
}
.danger {
  background-color: rgba(209, 41, 35, 0.815);
  color: #fff;
}
.primary {
  background-color: rgba(46, 121, 206, 0.815);
  color: #fff;
}
</style>